package com.example.demo.controller;

import com.example.demo.model.DbType;
import com.example.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/yml")
public class YmlController {
    @Value("${mykey}")
    private String key1;
    @Value("${mykey.key1}")
    private String key2;
    @Value("${string.str1}")
    private String s1;
    @Value("${string.str2}")
    private String s2;
    @Value("${string.str3}")
    private String s3;
    @Autowired
    private Student stu;
    @Autowired
    private DbType dbInfo;
    @RequestMapping("/getKey")
    public String getKey(){
        return key1 + ", " + key2;
    }
    @RequestMapping("/getString")
    public String getString(){
        return s1 + ", " + s2 + ", " + s3;
    }
    @RequestMapping("/getInfo")
    public Student getInfo(){
        return stu;
    }
    @RequestMapping("/getDb")
    public DbType getDbInfo(){
        return dbInfo;
    }
}
